package exceptionexer;

public class ThrowDemo {
    public static void main(String[] args) {
        Student zs = new Student();
        try {
            zs.setAge(1000);
            System.out.println("此人的年龄是:"+zs.getAge()+"岁");
        }catch (RuntimeException e){
            System.out.println("此人年龄不合法");
        }



//        Student zs = new Student();
//        try {
//            zs.setAge(1000);
//            System.out.println("此人的年龄是:"+zs.getAge()+"岁");
//        }catch (RuntimeException e){
//            System.out.println("此人年龄不合法");
//        }
    }
}
